package basic;

import java.util.ArrayList;
import java.util.Iterator;

public class ArrayListDifferenceArray {
    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();
        String[] intArray = new String[10000];
        for(int i=0;i<10000;i++){
            intArray[i] = String.valueOf(i);
        }
        long endTime = System.currentTimeMillis();
        System.out.println("Array：" + String.valueOf(endTime-startTime));
//        intArray[2] = 3;//Array index is out of bounds more... (Ctrl+F1)

        UserVo[] userVos = new UserVo[6];

        startTime = System.currentTimeMillis();
        ArrayList<String> ints = new ArrayList<String>(2);
        for(int i=0;i<10000;i++){
            ints.add(String.valueOf(i));
        }
        endTime = System.currentTimeMillis();
        System.out.println("ArrayList：" + String.valueOf(endTime-startTime));

//        ints.add(2);
//        System.out.println("初次加载" + ints);
//        ints.addAll(ints);
//        System.out.println("addAll()：" + ints);
//        ints.removeAll(ints);
//        System.out.println("removeAll()：" + ints);
//        System.out.println("遍历ArrayList的每一个参数");
//        ints.add(0);
//        ints.add(1);
//        ints.add(2);
//        Iterator<Integer> iterator = ints.iterator();
//        while (iterator.hasNext()){
//            Integer next = iterator.next();
//            System.out.println(next);
//        }
//        ArrayList<int> ints = new ArrayList<int>();//Type argument cannot be of primitive type

    }
}
